<template>
  <div class="frame_block">
    <div class="title_header">
      <img src="@/assets/images/components/frame_block/tltleHeaderLeft.png" alt="" />
      <div></div>
      <img src="@/assets/images/components/frame_block/tltleHeaderRight.png" alt="" />
    </div>
    <div class="title" v-if="title">
      <img class="blockLeft" src="@/assets/images/components/frame_block/blockLeft.png" alt="" />
      <img class="blockRight" src="@/assets/images/components/frame_block/blockRight.png" alt="" />
      <div>
        <img class="titleIcon" src="@/assets/images/components/frame_block/titleIcon.png" alt="" />
        <div class="titleText" style="display: inline-block">{{ title }}</div>
      </div>
    </div>
    <div v-else style="border-top: 0.5px solid #00fffb42"></div>
    <div class="content">
      <slot></slot>
    </div>
  </div>
</template>

<script setup name="FrameBlock" lang="ts">
const props = defineProps({
  title: String
})
</script>

<style lang="scss" scoped>
.frame_block {
  padding: 10px 10px;
  display: flex;
  flex-direction: column;
}
.title_header {
  margin-bottom: 8px;
  padding: 0 15px 0 0px;
  display: flex;
  align-items: center;
  & > img:nth-child(1) {
    width: 45px;
  }
  & > div:nth-child(2) {
    flex-grow: 1;
    border-top: 0.1px solid #1f808b85;
  }
  & > img:nth-child(3) {
    width: 49px;
  }
}
.content {
  flex-grow: 1;
  background-image: linear-gradient(
    160deg,
    rgba(255, 255, 255, 0),
    rgba(255, 255, 255, 0),
    rgb(0 255 251 / 14%)
  );
  border: 0.5px solid #00fffb42;
  border-top: none;
}
.title {
  border: 0.5px solid #00fffb42;
  border-bottom: none;
  width: 100%;
  height: 45px;
  position: relative;
  background: linear-gradient(to right, rgb(0 255 251 / 12%), rgb(255 255 255 / 5%));
  .blockRight {
    position: absolute;
    width: 280px;
    left: -4px;
    top: -3px;
  }
  .blockLeft {
    position: absolute;
    top: -5px;
    right: -6px;
    width: 42px;
  }
  & > div {
    width: 100%;
    height: 45px;
    top: 0;
    display: flex;
    align-items: center;
  }
  .titleIcon {
    width: 22px;
    margin-left: 18px;
  }
  .titleText {
    font-size: 18px;
    font-weight: 700;
    margin-left: 12px;
    background: linear-gradient(to bottom, #00fffb, #fff);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}
</style>